package cn.fan.whale.scheduler;

import cn.fan.whale.common.GlobalVal;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class CleanCacheScheduler {

    @Scheduled(cron = "0 0 2 * * ?")
    public void cleanCache() {
        log.info("clear cache...");
        GlobalVal.RETRY_TIMES.clear();
        GlobalVal.VALIDATE_CODE_MAP.clear();
    }
}
